package topo;


import util.IdNumberFactory;



public class Node  {
    private int label;
    private int tip;


    public Node(){
    	label = IdNumberFactory.getId();
    }
    
    public Node(int label){
    	this.label = label;
    }
    
    public Node copy(){
    	Node copiedState;
    	try {
			copiedState=(Node)getClass().newInstance();
		} 
    	catch (Throwable e) {
			System.err.println("Warning: clone of automaton failed!");
            return null;
		}
    	copiedState.setLabel(label);
    	copiedState.setTip(tip);
    	
    	return copiedState;
    }
    
    public boolean equals(Node aState){
    	return label == aState.getLabel();
    }
    
    public int getLabel() {
        return label;
    }

    public void setLabel(int label) {
        this.label = label;
    }

    public String toString() {
        return String.valueOf( getLabel() );
    }

    public int getTip() {
        return tip;
    }

    public void setTip(int tip) {
        this.tip = tip;
    }

}
